#!/bin/bash

PASSWORD=123456

if [ $# == 1 ]
then
    PASSWORD=$1
fi

echo "GENERATING KEYSTORE WITH PASSWORD: $PASSWORD ..."

#echo -e "$PASSWORD\n$PASSWORD\nJonathan\ncrepes\ncrepes\nPhiladelphia\nPA\nUS\nyes\n\n" | keytool -genkey -keystore mitm.jks -keyalg RSA 
echo -e "$PASSWORD\n$PASSWORD\nSteve\nEncryption\nSignCo\nPhiladelphia\nPA\nUS\nyes\n\n" | keytool -genkey -keystore mitm.jks -keyalg RSA 

if [ $? != 0 ]
then
    echo -e "\n ERROR! Check previous output..."
else
    echo -e "\n... Done!"
fi
